<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>发票</title>
    <c:if test="${param.v=='3.0'}">
        <jsp:include page="../../head.jsp"/>
    </c:if>
    <style type="text/css">
        table tr {
            text-align: left;
            font-size: 13px;
            padding: 3px 0px;
        }

        .table_list_name {
            text-align: right
        }

        .declarationInvoice {
            font-size: 18px;
            font-weight: bold;
            padding: 5px 0px;
        }

        .table-border tr td, .table-border tr th {
            border: 1px solid #000;
        }

        .table-border tr th {
            text-align: center;
        }

        .table-margin {
            margin-top: 10px
        }

        .tr_line {
            line-height: 25px;
        }

        .table_txt tr td {
            width: 15%
        }
    </style>
</head>
<body>
<div>
    <table id="declarationInvoice" style="width: 100%" class="table-input tr_line table_txt">
        <tr>
            <td colspan="6" align="center" class="declarationInvoice">${declare.seller}</td>
        </tr>
        <tr>
            <td colspan="6" align="center" class="declarationInvoice"
                style="border-top:1px solid #DADADA ">发 票
            </td>
        </tr>
        <tr>
            <td colspan="6" align="center">I N V O I C E</td>
        </tr>
        <tr>
            <td>&nbsp</td>
            <td class="table_list_name">客户名称：</td>
            <td>${declare.buyer}</td>
            <td class="table_list_name">日期：</td>
            <td><fmt:formatDate value="${declare.contract_date}" pattern="yyyy-MM-dd"/></td>
            <td>&nbsp</td>
        </tr>
        <tr>
            <td>&nbsp</td>
            <td class="table_list_name">发票编码：</td>
            <td>${declare.invoice_no}</td>
            <td class="table_list_name">运抵国：</td>
            <td>${declare.arrived_country}</td>
            <!-- 				<td class="table_list_name">箱唛：</td> -->
            <%-- 				<td>${declare.carton}</td> --%>
            <td>&nbsp</td>
        </tr>
        <tr>
            <td>&nbsp</td>
            <td class="table_list_name">成交方式：</td>
            <td>${declare.deal_mode}</td>
            <!-- 				<td class="table_list_name">境内货源地：</td> -->
            <%-- 				<td>${declare.goods_addr}</td> --%>

            <td>&nbsp</td>
        </tr>
    </table>
    <table style="width: 100%"
           class="ui-jqgrid ui-widget ui-widget-content ui-corner-all tr_line table-margin ">
        <tr>
            <c:if test="${declare.record_id != null}">
                <th class="ui-state-default ui-th-column ui-th-ltr">项号</th>
            </c:if>
            <th class="ui-state-default ui-th-column ui-th-ltr">商品名称</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">规格型号</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">数量</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">计价单位</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">单价</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">币制</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">总金额</th>
        </tr>
        <c:forEach var="cm" items="${declare.commodities}" varStatus="st">
            <tr class="ui-widget-content jqgrow ui-row-ltr">
                <c:if test="${declare.record_id != null}">
                    <td>${cm.handbook_item_no}</td>
                </c:if>
                <td>${cm.name}</td>
                <td>${cm.key_elements}</td>
                <td>${cm.count}</td>
                <td>${cm.unit}</td>
                <td>${cm.unit_price}</td>
                <td>${cm.currency}</td>
                <td>${cm.total_price}</td>
            </tr>
        </c:forEach>
        <tr class="ui-widget-content jqgrow ui-row-ltr">
            <c:if test="${declare.record_id != null}">
                <td colspan="7" align="right" style="text-align: right;">合计/Total:</td>
            </c:if>
            <c:if test="${declare.record_id == null}">
                <td colspan="6" align="right" style="text-align: right;">合计/Total:</td>
            </c:if>
            <td>${declare.total_money}</td>
        </tr>
    </table>
</div>
</body>
</html>